using System;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Text;
namespace MicroMsg.UI.Page
{
	public static class JsonStringSerializer
	{
		public static T Deserialize<T>(string strData) where T : class
		{
			DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(T));
			byte[] bytes = Encoding.get_UTF8().GetBytes(strData);
			MemoryStream memoryStream = new MemoryStream(bytes);
			T result = dataContractJsonSerializer.ReadObject(memoryStream) as T;
			memoryStream.Dispose();
			return result;
		}
	}
}
